using UnityEngine;
using System.Collections;

public class EnemyInstanceManager : MonoBehaviour {

	public Transform[] enemies;
	public Transform[] spawnPoints;
	public float interval;
	
	void Start()
	{
		StartCoroutine("spawnInstance");
	}
	
	IEnumerator spawnInstance()
	{
		yield return new WaitForSeconds(interval);
		Instantiate(enemies[Random.Range(0,enemies.Length)],spawnPoints[Random.Range(0,spawnPoints.Length)].position,enemies[0].rotation);
		StartCoroutine("spawnInstance");
	}
	
}
